//
// Created by gummybear on 24-7-1.
//

#ifndef LEETCODE_QUESTION_H
#define LEETCODE_QUESTION_H

#include "common.h"

class Solution_28 {
public:
    static int strStr(std::string haystack, std::string needle);
    static void genNext(const std::string &str, std::vector<int> &next);
};

class Solution_No1 {
public:
    static bool findInt(const std::vector<std::vector<int>>& origin_data, int target_int);
};

class Solution_No2 {
public:
    static std::string replaceSpace(std::string &origin_data);
};

class Solution_No3 {
public:
    static std::vector<int> printListFromTailToHead(ListNode* head);
};

class Solution_No4 {
public:
    static TreeNode* reConstructBinaryTree(const std::vector<int> &preOrder, const std::vector<int> &vinOrder);
};

class Solution_No5 {
public:
    void push(int node);
    int pop();
private:
    std::stack<int> stack1;
    std::stack<int> stack2;
};

class Solution_No6 {
public:
    static int minNumberInRotateArray(const std::vector<int> &nums);
};

class Solution_No7 {
public:
    static int Fibonacci(int n);
};

class Solution_No8 {
public:
    static int jumpFloor(int number);
};

class Solution_No9 {
public:
    static int jumpFloorII(int number);
};

class Solution_No10 {
public:
    static int rectCover(int number);
};

class Solution_No11 {
public:
    static int NumberOf1(int n);
};

class Solution_No12 {
public:
    static double power(double base, int exponent);
};

class Solution_No13 {
public:
    static std::vector<int> reOrderArray(std::vector<int> &array);
};

class Solution_No14 {
public:
    static int findKthToTail(ListNode* pListHead, unsigned int k);
};

class Solution_No15 {
public:
    static ListNode* ReverseList(ListNode* head);
    static ListNode* ReverseList_2(ListNode* head);
};

class Solution_No16 {
public:
    static ListNode* Merge(ListNode* pHead1, ListNode* pHead2);
};

class Solution_No17 {
public:
    static bool HasSubtree(TreeNode* pRoot1, TreeNode* pRoot2);
};

class Solution_No18 {
public:
    static TreeNode* Mirror(TreeNode* pRoot);
};

class Solution_No19 {
public:
    static std::vector<int> printMatrix(std::vector<std::vector<int>> matrix);
};

class Solution_No20 {
public:
    int min();
    void push(int value);
    int top();
    void pop();
    bool empty();
private:
    std::vector<int> data;
};

class Solution_No21 {
public:
    static bool IsPopOrder(std::vector<int> &pushV, std::vector<int> &popv);
};

class Solution_No22 {
public:
    static std::vector<int> PrintFromTopToBottom(TreeNode* root);
};

class Solution_No23 {
public:
    static bool VerifySequenceOfBST(std::vector<int> &sequence);
};

#endif //LEETCODE_QUESTION_H
